home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 7 / FM Towns Free Software Collection 7.iso / taropyon / guilib3 / inc / disp.h < prev    next >
C/C++ Source or Header  |  1993-11-30  |  11KB  |  309 lines

  1. /*    :*****************************************************************
  2.     :    "disp.h"     :    system“Pride”ディスプレイ・ライブラリ
  3.     :*****************************************************************
  4. */
  5. #ifndef    _DISP_H
  6. #define    _DISP_H
  7.  
  8. #ifndef    _GUIDEFS_H
  9. #    include    <guidefs.h>
  10. #endif
  11.  
  12. #define    COLMIX(c1,c2)    (0x1000|(((c1)&15)<<4)|((c2)&15))
  13.  
  14. extern    int        FONTseg;                /* 12ドットフォントセレクタ        */
  15. extern    int        ICONseg;                /* 24×ドットアイコンセレクタ    */
  16.  
  17. /*    "dspini.c"        ------------------------------------------------*/
  18. /*    通常アプリケーション用初期化    */
  19. extern    int        DSP_sysInit( DSPCTRL *dspctrl_ptr );
  20. extern    void    DSP_sysEnd(void);
  21.  
  22. /*    "dsprini.c"        ------------------------------------------------*/
  23. extern    int        DSP_sysReInit(void);
  24.  
  25. /*    "dspsdk.c"        ------------------------------------------------*/
  26. /*    サイドワーク・アプリケーション用初期化    */
  27. extern    int        DSP_sdk_sysInit( DSPCTRL *dspctrl_ptr );
  28. extern    void    DSP_sdk_sysEnd(void);
  29.  
  30. /*    "dsppcl.c"        ------------------------------------------------*/
  31. /*    子プロセス・アプリケーション用初期化    */
  32. extern    int        DSP_pcl_sysInit( DSPCTRL *dspctrl_ptr );
  33. extern    void    DSP_pcl_sysEnd(void);
  34.  
  35. /*    "dsptile.c"        ------------------------------------------------*/
  36. extern    void    DSP_setTilePattern( int md, COLOR c1, COLOR c2 );
  37.  
  38. /*    "dspwpage.c"    ------------------------------------------------*/
  39. extern    void    DSP_writePage(int page);
  40.  
  41. /*    "dspcnvp.c"        ------------------------------------------------*/
  42. #define    _CVTPOINT(x1,y1,x2,y2)    {                    \
  43.     int        _wk;                                    \
  44.     if ( (x1) > (x2) )                                \
  45.     {    _wk = (x1);    (x1) = (x2);    (x2) = _wk;        \
  46.     }                                                \
  47.     if ( (y1) > (y2) )                                \
  48.     {    _wk = (y1);    (y1) = (y2);    (y2) = _wk;        \
  49.     }                                                \
  50. }
  51. extern    void    _cvtPOINT(int *x1, int *y1, int *x2, int *y2);
  52.  
  53. /*    "dsppara.c"        ------------------------------------------------*/
  54. struct    DISPARA
  55. {    SHORT    col;
  56.     UCHAR    fun;
  57. };
  58. extern    struct    DISPARA     _dispara;
  59.  
  60. /*    "dsppset.c"        ------------------------------------------------*/
  61. struct    PSETPARA
  62. {    short int    n;
  63.     short int    x0, y0;
  64. };
  65. extern    struct    PSETPARA    _psetpara;
  66.  
  67. #define    pset(_x0,_y0,_fun,_col)    {    \
  68.         _dispara.col = (_col);        \
  69.         _dispara.fun = (_fun);        \
  70.         _psetpara.x0 = (_x0);        \
  71.         _psetpara.y0 = (_y0);        \
  72.         _pset();                    \
  73.     }
  74. extern    void    _pset(void);
  75.  
  76. /*    "dspline.c"        ------------------------------------------------*/
  77. struct    LINEPARA
  78. {    SHORT    n;
  79.     SHORT    x1, y1, x2, y2;
  80. };
  81. extern    struct    LINEPARA    _linepara;
  82.  
  83. #define    line(_x1,_y1,_x2,_y2,_fun,_col)    {            \
  84.         _dispara.col = (_col);                        \
  85.         _dispara.fun = (_fun);                        \
  86.         _linepara.x1 = (_x1); _linepara.y1 = (_y1);    \
  87.         _linepara.x2 = (_x2); _linepara.y2 = (_y2);    \
  88.         _line();                                    \
  89.     }
  90. extern    void    _line(void);
  91.  
  92. /*    "dspbox.c"        ------------------------------------------------*/
  93. struct    BOXPARA
  94. {    SHORT    x1, y1, x2, y2;
  95. };
  96. extern    struct    BOXPARA    _boxpara;
  97.  
  98. #define    box(_x1,_y1,_x2,_y2,_fun,_col)    {            \
  99.         _dispara.col = (_col);                        \
  100.         _dispara.fun = (_fun);                        \
  101.         _boxpara.x1 = (_x1); _boxpara.y1 = (_y1);    \
  102.         _boxpara.x2 = (_x2); _boxpara.y2 = (_y2);    \
  103.         _box();                                        \
  104.     }
  105. extern    void    _box(void);
  106.  
  107. /*    "dspboxf.c"        ------------------------------------------------*/
  108. #define    boxf(_x1,_y1,_x2,_y2,_fun,_col)    {            \
  109.         _dispara.col = (_col);                        \
  110.         _dispara.fun = (_fun);                        \
  111.         _boxpara.x1 = (_x1); _boxpara.y1 = (_y1);    \
  112.         _boxpara.x2 = (_x2); _boxpara.y2 = (_y2);    \
  113.         _boxf();                                    \
  114.     }
  115. extern    void    _boxf(void);
  116.  
  117. /*    "dsp_hv.c"        ------------------------------------------------*/
  118. extern    void    HVbox(int x1, int y1, int x2, int y2, COLOR col);
  119. extern    void    HVboxf( int x1, int y1, int x2, int y2, COLOR col );
  120. extern    void    boxCON(int x1, int y1, int x2, int y2, COLOR hil, COLOR sha );
  121. extern    void    boxHOL(int x1, int y1, int x2, int y2, COLOR hil, COLOR sha );
  122. extern    void    boxfHOL(int x1, int y1, int x2, int y2, COLOR col, COLOR hil, COLOR sha );
  123.  
  124. /*    "vram.asm"        ------------------------------------------------*/
  125. #define    PAGE0    0x00000
  126. #define    PAGE1    0x40000
  127.  
  128. #define    WRTADR(x,y)        ((x)/2)+((y)*512)
  129. #define    WRTPAGE(p)        (p*PAGE1)
  130. #define    WRTCOL(c)        _Col_cnv[c]
  131. #define    WRTSTR(s,x,y,col,bac,fnt)    wrtstr(s,WRTPAGE(DspCtrl.writePage),WRTADR(x,y),WRTCOL(col),WRTCOL(bac),fnt)
  132. #define    WRTCLS(x0,y0,xs,ys,col)        vram_cls(WRTPAGE(DspCtrl.writePage)+WRTADR(x0,y0),xs,ys,WRTCOL(col))
  133. #define    WRTANK(ch,x0,y0,col,bac)    wrt_ank(ch,WRTPAGE(DspCtrl.writePage)+WRTADR(x0,y0),WRTCOL(col),WRTCOL(bac))
  134. #define    WRTKAN(ch,x0,y0,col,bac)    wrt_kan(ch,WRTPAGE(DspCtrl.writePage)+WRTADR(x0,y0),WRTCOL(col),WRTCOL(bac))
  135.  
  136. extern    void    wrtstr(CONST char *str,int page,int adr,int ccol,int bcol,int font);
  137. extern    void    vram_cls( int adr,int siz,int len,int cl);
  138. extern    void    vram_scrool( int adr,int siz,int len,int cl);
  139. extern    void    vram_bk_scr( int adr,int siz,int len,int cl);
  140. extern    void    wrt_ank(int ch,int adr,int fc,int bc);
  141. extern    void    wrt_kan(int ch,int adr,int fc,int bc);
  142.  
  143. /*    "dspblk.c"        ------------------------------------------------*/
  144. typedef struct
  145. {    char        *ptn;
  146.     SHORT        sel;
  147.     FRAME        fr;
  148.     char        _dmy[2];
  149.     char        img[1];
  150. } GBLK;
  151.  
  152. extern    GBLK    *DSP_push_vram( FRAME *fr );
  153. extern    void    DSP_pop_vram( GBLK *gbuf );
  154. extern    void    DSP_dsp_vram( GBLK *gbuf );
  155.  
  156. /*    "dspvblk.c"        ------------------------------------------------*/
  157. typedef    struct
  158. {    char        *path;        /* パス名            */
  159.     int            page;        /* 書き込みページ    */
  160.     char        *ptn;
  161.     short int    sel;        /* セレクタ            */
  162.     FRAME        fr;
  163.     char        _dmy[2];
  164.     char        img[1];
  165. } VGBLK;
  166.  
  167. #define    VDPUSH_AUTO    (0)
  168. #define    VDPUSH_MEM    (1)
  169. #define    VDPUSH_DSK    (2)
  170. extern    char    DspSwapDir[128];
  171.  
  172. extern    VGBLK    *DSP_VDpushVram( int md, int x1, int y1, int x2, int y2);
  173. extern    void    DSP_VDpopVram( VGBLK *para );
  174. extern    void    DSP_VDdspVram( VGBLK *para, int x0, int y0 );
  175. extern    void    DSP_VDfreeVram( VGBLK *para );
  176.  
  177. /*    "dspvblk2.c"    ------------------------------------------------*/
  178. extern    VGBLK    *DSP_VDswapOut( VGBLK *para );
  179. extern    VGBLK    *DSP_VDswapIn( VGBLK *para );
  180.  
  181. /*    "dspsym.c"        ------------------------------------------------*/
  182. extern    void    DSP_symbol( int x0, int y0, int xb, int yb, int fun, COLOR col, COLOR bac, int font, int fntdir, int dspdir, int space, CONST char *form, ... );
  183.  
  184. /*    "dspfnt.c"        ------------------------------------------------*/
  185. #define    FNTYPE_ROM    (0)    /* ROM フォント                    */
  186. #define    FNTYPE_USR1    (1)    /* system Pride 標準フォント    */
  187. #define    FNTYPE_USR2    (2)    /* ROM フォントバリエーション    */
  188.  
  189. extern    int        _dsp_setFntTbl( int typ );
  190. extern    void    DSP_set_defFnt( int typ );
  191. extern    int        (*DSP_setFntTbl)(int);
  192.  
  193. /*    "dspplt.c"        ------------------------------------------------*/
  194. typedef    struct
  195. {    UCHAR    g, r, b;
  196. } PLT_RGB;
  197.  
  198. extern    void    DSP_setPlt( PLT_RGB *rgb );
  199.  
  200. /*    "dspplt1.c"        ------------------------------------------------*/
  201. extern    PLT_RGB    *DSP_pushPlt(void);
  202. extern    void    DSP_popPlt( PLT_RGB *rgb );
  203.  
  204. /*    "line.asm"        ------------------------------------------------*/
  205. #define    HV_Y(y)                    ((y)+DspCtrl.writePage*512)
  206. #define    _Vline0(x,y1,y2,col)    VLine_m00(x,y1,y2,col)
  207. #define    _Vline(x,y1,y2,col)        VLine_m01(x,y1,y2,col)
  208. #define    _Hline(x1,x2,y,col)        HLine_m01(x1,x2,y,col)
  209.  
  210. #define    Vline0(x,y1,y2,col)        VLine_m00(x,HV_Y(y1),HV_Y(y2),col)
  211. #define    Vline(x,y1,y2,col)        VLine_m01(x,HV_Y(y1),HV_Y(y2),col)
  212. #define    Hline(x1,x2,y,col)        HLine_m01(x1,x2,HV_Y(y),col)
  213.  
  214. extern    void    VLine_m00( int x ,int y0,int y1,int color );
  215. extern    void    VLine_m01( int x ,int y0,int y1,int color );    /* マスクI/O使用    */
  216. extern    void    HLine_m01( int x0,int x1,int y ,int color );
  217.  
  218. /*    "dspwrt.c"        ------------------------------------------------*/
  219. extern    int        _Col_cnv[];
  220. extern    void    DSP_str( int x, int y, int col,int bac, int fnt, CONST char *form, ... );
  221.  
  222. /*    "dsptit.c"        ------------------------------------------------*/
  223. extern    int        DspTitYs;
  224. extern    void    DSP_title( CONST char *apl, CONST char *ver, COLOR bacCol, COLOR strCol, COLOR basCol, COLOR boxCol );
  225.  
  226. /*    "dspview.c"        ------------------------------------------------*/
  227. extern FRAME    _viewFr;
  228. #define    DSP_view2(_x1,_y1,_x2,_y2)    {            \
  229.     FRAME    _viewFr;                            \
  230.     _viewFr.x1 = (_x1);    _viewFr.y1 = (_y1);        \
  231.     _viewFr.x2 = (_x2);    _viewFr.y2 = (_y2);        \
  232.     DSP_view( &_viewFr );                        \
  233. }
  234. extern    void    DSP_view( FRAME *fr );
  235.  
  236. /*    "dsprvs.c"        ------------------------------------------------*/
  237. extern    void    *DSP_get_image( FRAME *fr );
  238. extern    void     DSP_put_revers( void *_blk );
  239. extern    void     DSP_put_image( void *_blk );
  240. extern    void     DSP_free_image( void *blk );
  241.  
  242. /*    "dsp010.c"        ------------------------------------------------*/
  243. #define    DSPTN_RETKEY    (1)
  244. #define    DSPTN_UP        (2)
  245. #define    DSPTN_DOWN        (3)
  246. #define    DSPTN_LEFT        (4)
  247. #define    DSPTN_RIGHT        (5)
  248. #define    DSPTN_RESIZE    (6)
  249. #define    DSPTN_RESMAX    (7)
  250. #define    DSPTN_RESMIN    (8)
  251.  
  252. extern    void    DSP_putFont( int x0, int y0, int n, COLOR col, COLOR bac, int fun );
  253.  
  254. /*    "dsp011.c"        ------------------------------------------------*/
  255. extern    void    DSP_egbStr( int x0, int y0, COLOR col, COLOR bac, int fnt, CONST char *form, ... );
  256.  
  257. /*    "dsp012.c"        ------------------------------------------------*/
  258. extern    void    DSP_wrtstr12( CONST char *s, int x0, int y0, COLOR col, COLOR bac );
  259.  
  260. /*    "dsp013.c"        ------------------------------------------------*/
  261. extern    void    DSP_egbWrtstr12( CONST char *s, int x0, int y0, COLOR col, COLOR bac );
  262.  
  263. /*    "dsp014.c"        ------------------------------------------------*/
  264. extern    void    DSP_puts12( int x0, int y0, COLOR col, COLOR bac, CONST char *form, ... );
  265.  
  266. /*    "dsp014b.c"        ------------------------------------------------*/
  267. extern    void    DSP_putf12( int x0, int y0, COLOR col, COLOR bac, CONST char *form, ... );
  268.  
  269. /*    "dsp015.c"        ------------------------------------------------*/
  270. extern    void    DSP_egbPuts12( int x0, int y0, COLOR col, COLOR bac, CONST char *form, ... );
  271.  
  272. /*    "dsp12fnt.asm"    ------------------------------------------------*/
  273. extern    void    wrt_ank12(char *dat,int adr,int fc,int bc);
  274. extern    void    wrt_kan12(char *dat,int adr,int fc,int bc);
  275.  
  276. /*    "dsp020.c"        ------------------------------------------------*/
  277. extern    void    DSP_putGearIcon( int x0, int y0, int n, int sw, int fun,
  278.                          int col, int bac );
  279.  
  280. /*    "dsp030.c"        ------------------------------------------------*/
  281. extern    void    boxHol(int x1, int y1, int x2, int y2, int fun, COLOR hil, COLOR sha );
  282.  
  283. /*    "dsp031.c"        ------------------------------------------------*/
  284. extern    void    boxfHol(int x1, int y1, int x2, int y2, int fun, COLOR fil, COLOR hil, COLOR sha );
  285.  
  286. /*    "dsp032.c"        ------------------------------------------------*/
  287. extern    void    boxCon(int x1, int y1, int x2, int y2, int fun, COLOR hil, COLOR sha, int n );
  288.  
  289. /*    "dsp033.c"        ------------------------------------------------*/
  290. extern    void    boxfCon(int x1, int y1, int x2, int y2, int fun, COLOR fil, COLOR hil, COLOR sha, int n );
  291.  
  292. /*    "dsptime.c"        ------------------------------------------------*/
  293. extern    void    SetDspTime( int page, int x, int y, COLOR strCol, COLOR bacCol );
  294. extern    void    DspTime(void);
  295.  
  296. /*    "dspvscr.c"        ------------------------------------------------*/
  297. extern    void    VerticalScroll( FRAME *fr, int scrY );
  298.  
  299. /*    "boxmove.c"        ------------------------------------------------*/
  300. extern    void    BoxMoveAnime( FRAME *newFr, FRAME *oldFr, int frBox, int clk );
  301.  
  302. /*    "iskan.asm"        ------------------------------------------------*/
  303. #ifndef    _ISKAN_DEFINED
  304. #define    _ISKAN_DEFINED
  305. extern    int        iskan(CONST char *str);
  306. #endif
  307.  
  308. #endif
  309.